#include <stdio.h>
#include "swapping.h"

int a=4;
int b=5;
int e=0;

int main(void){
printf("originally a have the value %d\n",a);
printf("originally b have the value %d\n",b);
swap(&a, &b); //Sender adressen for a og b

printf("a has got the value: %d \n",a);
printf("b has got the value: %d \n",b);
return 0;
}

void swap(int* c, int* d){ //modtager adressen som en integer reference
	e = *c; //sætter e = værdien adressen for a refererer til (a)
	*c = *d; //sætter adressen for c = adressen for d
	*d = e; //sætter adressen for d = værdien for e (adressen for c)
}
